#include<iostream>
using namespace std;
const int N = 50;
int arr[N][N];
int n;
int main()
{
	cin >> n;
	arr[1][n / 2 + 1] = 1;
	int a = 1, b = n / 2 + 1;
	int k = 2;
	int t = n * n - 1;
	while (t--) {
		if (a == 1 && b != n) {
			arr[n][b + 1] = k++;
			a = n;
			b = b + 1;
		}
		else if (b == n && a != 1) {
			arr[a - 1][1] = k++;
			a = a - 1;
			b = 1;
		}
		else if (a == 1 && b == n) {
			arr[a + 1][b] = k++;
			a = a + 1;
			b = b;
		}
		else {
			if (arr[a - 1][b + 1] == 0) {
				arr[a - 1][b + 1] = k++;
				a = a - 1;
				b = b + 1;
			}
			else {
				arr[a + 1][b] = k++;
				a = a + 1;
				b = b;
			}
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cout << arr[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}